#!/bin/bash

USERNAME="mysql_username"
PASSWORD="mysql_password"
DBNAME="databasses_name"
TABLE_NAME="table_name"
now_time=`date +"%Y-%m-%d %T"`
function one_device_insert()
{
    for i in {0..10080}
    do
        time_use=`date -d -${i}minute +"%Y-%m-%d %T"`
        echo $1
        #table_value1、2、3为对应表的属性
        INSERT_DATA_SQL="insert into ${TABLE_NAME} (table_value1,time,table_value2,table_value3) VALUES('$1','${time_use}',100,1);"
        mysql -u${USERNAME} -p${PASSWORD} ${DBNAME} -e "${INSERT_DATA_SQL}"
        echo $time_use
    done
}
for i in {100..201} 
do
    one_device_insert SSS8888$i
done